<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>服务器在用情况统计</title>
    <link rel="stylesheet" href="{{ url_for('static',filename='CSS/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static',filename='CSS/style.css') }}">
    <script src="{{ url_for('static',filename='JS/jquery-3.5.1.js') }}"></script>
</head>
<body>

<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand">服务器在用情况统计(SUS)</a>
        </div>
        <div class="search">
            <form class="form-inline" action="/search" method="post">
                <div class="form-group">
                    <select class="form-control" name="search_field" id="search_field">
                        <option value="sid">序列号</option>
                        <option value="model">设备型号</option>
                        <option value="cpu_model">CPU型号</option>
                        <option value="cpu_cores">CPU核数</option>
                        <option value="bmc_address">管理地址</option>
                        <option value="purpose">用途</option>
                        <option value="owner">使用者</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="exampleInputName2">包含</label>
                    <input class="form-control" type="text" name="search_value" id="search_value">
                </div>
                <input type="submit" class="btn btn-primary" name="search_button" id="search_button" value="查找">
            </form>
        </div>
    </div>
</nav>


<table class="table table-bordered">
    <thead>
    <tr>
        <td class="number"><strong>No.</strong></td>
        <td class="serialnumber"><strong>序列号</strong></td>
        <td class="model"><strong>型号</strong></td>
        <td class="cpu_model"><strong>CPU型号</strong></td>
        <td class="cpu_cores"><strong>CPU核数</strong></td>
        <td class="bmc_address"><strong>BMC地址</strong></td>
        <td class="purpose"><strong>用途</strong></td>
        <td class="owner"><strong>使用者</strong></td>
        <td class="others"><strong>备注</strong></td>
    </tr>
    </thead>
    <tbody>
    {% for device in data %}
        <tr>
            <td>{{ loop.index }}</td>
            <td>{{ device.sid }}</td>
            <td>{{ device.model }}</td>
            <td>{{ device.cpu_model }}</td>
            <td>{{ device.cpu_cores }}</td>
            <td>
                <a href="https://{{ device.bmc_address }}" target="_blank">{{ device.bmc_address }}</a>
            </td>
            <td>{{ device.purpose }}</td>
            <td>{{ device.owner }}</td>
            {% if device.others %}
                <td>{{ device.others }}</td>
            {% else %}
                <td></td>
            {% endif %}
        </tr>
    {% endfor %}
    </tbody>
</table>
<div class="alert alert-warning">
    <p>作者说：</p>
    <p>可以提出需求，提了我也不做。你可以提建议，但不一定会采纳 <span class="glyphicon glyphicon-comment"></span></p>
    <p>接受狗狗币打赏，不给就算了，反正你也习惯了白嫖！狗狗币地址：DGRN9SB9AWVKj14LodHV3Txwu6CMD6dCcJ</p>
    <p>需要源码请移步码云:
        <a href="https://gitee.com/china_chenyang/cmdb.git" target="_blank">
            <span class="glyphicon glyphicon-floppy-save"></span>
        </a>
    </p>
</div>

</body>
</html>